// 导入模板封装的axios工具
import request from '@/utils/request'

/**
 * 查询
 * @param {Object} params
 */
export function dataAPI(params) {
  return request({
    url: '/sysdicttype/data',
    method: 'GET',
    params
  })
}

/**
 * 查询
 * @param {Object} params
 */
export function dataAllAPI(params) {
  return request({
    url: '/sysdicttype/data/all',
    method: 'GET',
    params
  })
}




/**
 * 新增
 * @param {Object} data
 */
export function addApi(data) {
  return request({
    url: '/sysdicttype/',
    method: 'POST',
    data
  })
}

/**
 * 修改
 * @param {Object} data
 */
export function editApi(data) {
  return request({
    url: '/sysdicttype/',
    method: 'put',
    data
  })
}


/**
 * 根据主键查询
 * @param {Object} id
 */
export function findByIdApi(id) {
  return request({
    url: '/sysdicttype/'+id,
    method: 'get'
  })
}

/**
 * 根据主键删除&批量删除
 * @param ids
 * @returns {*}
 */
export function deleteByIdApi(ids) {
  return request({
    url: '/sysdicttype/'+ids,
    method: 'delete'
  })
}


/**
 * 刷新缓存
 */
export function freshCache() {
  return request({
    url: '/sysdicttype/refresh',
    method: 'post'
  })
}
